<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>hello onlyoffice</title>
    <!-- onlyoffice服务器安装好后，提供的api.js-->
    <script type="text/javascript" src="http://localhost/web-apps/apps/api/documents/api.js"></script>

</head>
<body style="height: 900px;">
<div id="placeholder" ></div>
<script type="text/javascript">
    var docEditor = new DocsAPI.DocEditor("placeholder",{
        "document":{
            "fileType": "docx",
            "key":'Khirz6zTPdfd7',  // 保证文档的唯一，可以用uuid
            "permissions":{
                "edit": true  // false 为只读，true 可以编辑
            },
            "title":"onlyoffice-demo.docx",
            "url":"http://localhost:8081/2.docx" // 编辑或查看的文档地址
        },
        "documentType":"text", // doc为text ，excle为spreadsheet，ppt为presentation
        "editorConfig":{
            "lang":"zh-CN",
            "callbackUrl":"http://localhost:8081/onlyOffice/save/"+"1688923542597169154",  // 保存文档的地址
            "user":{
                "id":"1",
                "name":"测试人"
            },
            "customization":{
                "autosave": false,
                "chat": false,
                "comments":false,
                "help": false,
                "plugins": false,
                "forcesave": true
            }
        },
        "height":"100%",
        "width":"100%",
        "token":"Bearer wGiOkOqVtnRoOsnMZNByjxd42AjyBc"

    })

</script>

</body>
</html>
